<%@ page contentType='text/html; charset=iso-8859-1' language="java" errorPage="../interface/erro.jsp" %>
<%@ page pageEncoding="UTF-8"%>
<%@ include file="../WEB-INF/jspf/setMeta.jspf" %>
<%@ include file="../WEB-INF/jspf/varGlobal.jspf" %>
<%@ include file="../WEB-INF/jspf/acesso.jspf" %>

<html> 
      <head></head>
      <body onload="javascript:monta();">
          
          <form name="form1" method="post" action="../controller/registrarLog.jsp">
            
          <input type="hidden" name="idLogSGCA" value="" />
          <input type="hidden" name="usuario" value="" />
          <input type="hidden" name="idSolicitacao" value="" />
          <input type="hidden" name="equipe" value="" />
          <input type="hidden" name="cliente" value="" />
          <input type="hidden" name="dataLog" value="" />
          <input type="hidden" name="horaLog" value="" />
          <input type="hidden" name="acao" value="" />
          <input type="hidden" name="nomeComputador" value="" />
          <input type="hidden" name="ipComputador" value="" />
          <input type="hidden" name="proxPagina" value="../interface/visualizarSolicitacoesEmAtendimento.jsp" />
          <input type="hidden" name="mensagem" value="Solicitação inserida com sucesso!" />
          
    <script language="javascript" type="text/javascript">
      
      function monta(){ 
      
     <sql:query var='rsetSolicitacao' dataSource='${con}'>
    
        SELECT Solicitacao.idSolicitacao FROM Solicitacao
        WHERE ( Solicitacao.atendenteInicial='${param.usuario}'
        AND Solicitacao.equipe='<c:out value="${param.equipe}"/>'
        AND Solicitacao.cliente='<c:out value="${param.cliente}"/>' )        
        ORDER BY Solicitacao.idSolicitacao DESC
    
      </sql:query>       
     
              document.form1.usuario.value = "<c:out value="${param.atendenteInicial}"/>";
              document.form1.idSolicitacao.value = "${rsetSolicitacao.rowsByIndex[0][0]}";
              document.form1.equipe.value = "<c:out value="${param.equipe}"/>";
              document.form1.cliente.value = "<c:out value="${param.cliente}"/>";
              document.form1.dataLog.value = "<c:out value=""/>";
              document.form1.horaLog.value = "<c:out value=""/>";
              document.form1.acao.value = "Registrou a solicitação";
              document.form1.nomeComputador.value = "<c:out value=""/>";
              document.form1.ipComputador.value = "<c:out value=""/>";
              document.form1.submit();
      }
      
      </script>
      </body>
  </html> 